package com.study.composite.demo.transparent;

public class Test {
    public static void main(String[] args) {
        CourseComponent javaBase = new Course("java基础",8280);
        CourseComponent ai = new Course("人工只能",2000);

        CourseComponent packageCourse = new CoursePackage("架构师课程",2);
        CourseComponent design = new Course("设计模式",3000);
        CourseComponent source = new Course("源码分析",6460);

        packageCourse.addChild(design);
        packageCourse.addChild(source);

        CourseComponent gupao = new CoursePackage("鼓泡课程",1);
        gupao.addChild(javaBase);
        gupao.addChild(ai);
        gupao.addChild(packageCourse);

        gupao.print();
    }
}
